# 杨辉三角
class Solution:
    def generate(self, numRows: int):
        result = [[1 for _ in range(x)] for x in range(1, numRows + 1)]
        for i in range(2, numRows):
            for j in range(1, i):
                result[i][j] = result[i-1][j-1] + result[i-1][j]
        return result


if __name__ == '__main__':
    so = Solution()

    r = so.generate(5)
    print(r)
